package com.yanqu.road.entity.activity.suitang.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.suitang.enums.eSuiTangWarType;
import org.apache.mina.util.ConcurrentHashSet;

import java.sql.Types;
import java.util.Set;

/**
 * 安民布告
 */
@FieldTypeAnnotation(tableName = "t_c_suitang_union_bugao_data")
public class CrossSuiTangUnionBuGaoData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "商会分组ID", select = true, update = true)
    private int groupId;

    @FieldTypeAnnotation(desc = "商会ID", update = true)
    private String unionUid = "";

    @FieldTypeAnnotation(desc = "活动分组，每轮都会进行重新分组")
    private int actGroupId;

    @FieldTypeAnnotation(desc = "当前轮次")
    private int round;

    @FieldTypeAnnotation(desc = "当前所在战场")
    private eSuiTangWarType warType;

    @FieldTypeAnnotation(desc = "玩家ID")
    private long userId;

    @FieldTypeAnnotation(desc = "商会内唯一编号（不同商会可以相同）", update = true)
    private long buGaoNo;

    @FieldTypeAnnotation(desc = "宝箱ID")
    private int goodId;

    @FieldTypeAnnotation(desc = "时间")
    private long time;

    @FieldTypeAnnotation(desc = "领奖玩家ID", sqlType = Types.LONGVARCHAR)
    private Set<Long> getRewardUserList = new ConcurrentHashSet<>();

    // ========================================================================
    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getGroupId() {
        return groupId;
    }
    public void setGroupId(int groupId) {
        if (this.groupId != groupId) {
            this.groupId = groupId;
            setOp(DataStatus.Update);
        }
    }

    public String getUnionUid() {
        return unionUid;
    }
    public void setUnionUid(String unionUid) {
        if (unionUid == null){
            return;
        }
        if (this.unionUid == null || !this.unionUid.equals(unionUid)) {
            this.unionUid = unionUid;
            setOp(DataStatus.Update);
        }
    }

    public int getActGroupId() {
        return actGroupId;
    }
    public void setActGroupId(int actGroupId) {
        if (this.actGroupId != actGroupId) {
            this.actGroupId = actGroupId;
            setOp(DataStatus.Update);
        }
    }

    public int getRound() {
        return round;
    }
    public void setRound(int round) {
        if (this.round != round) {
            this.round = round;
            setOp(DataStatus.Update);
        }
    }

    public eSuiTangWarType getWarType() {
        return warType;
    }
    public void setWarType(eSuiTangWarType warType) {
        if (null == warType){
            return;
        }
        if (this.warType == null || !this.warType.equals(warType)) {
            this.warType = warType;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public long getBuGaoNo() {
        return buGaoNo;
    }
    public void setBuGaoNo(long buGaoNo) {
        if (this.buGaoNo != buGaoNo) {
            this.buGaoNo = buGaoNo;
            setOp(DataStatus.Update);
        }
    }

    public int getGoodId() {
        return goodId;
    }
    public void setGoodId(int goodId) {
        if (this.goodId != goodId) {
            this.goodId = goodId;
            setOp(DataStatus.Update);
        }
    }

    public long getTime() {
        return time;
    }
    public void setTime(long time) {
        if (this.time != time) {
            this.time = time;
            setOp(DataStatus.Update);
        }
    }

    public Set<Long> getGetRewardUserList() {
        return getRewardUserList;
    }
    public void setGetRewardUserList(Set<Long> getRewardUserList) {
        if (null == getRewardUserList){
            return;
        }
        if (this.getRewardUserList == null || !this.getRewardUserList.equals(getRewardUserList)) {
            this.getRewardUserList = getRewardUserList;
            setOp(DataStatus.Update);
        }
    }
}
